import React, { Component } from 'react'
// import Axios from 'axios'

export default class Student extends Component {

    state={
        StudentList:[],
    }

 componentDidMount(){
    this.getData()
 }

 getData(){
     const url =' http://localhost/qwq/api.php/xy_users?transform=1&order=id,desc&page=1,10'
     axios.get(url)
         .then((res)=> {
            //  console.log(res.data.xy_users);
             this.setState({StudentList: res.data.xy_users})
         })
 }
  render() {
    return (
      <div>
        地址
        <table>
            <thead>
                <tr>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>班级</th>
                    <th>爱好</th> 
                </tr>
            </thead>
            <tbody>
                {this.state.StudentList.map(function(v,i){
                   return(
                       <tr key={i}>
                           <td>{v.name}</td>
                           <td>33</td>
                           <td>33</td>
                           <td>33</td>
                           <td>33</td>
                       </tr>
                   )
                })}
               
            </tbody>
        </table>
      </div>
    )
  }
}
